<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="format-detection" content="telephone=no">
    #parse("/h5/common/webWords.html")
<link rel="stylesheet" type="text/css" href="http://${staticHost}/css/medioadaption.css">
<link rel="stylesheet" type="text/css" href="http://${staticHost}/css/stcss.css">
<script type="text/javascript" src="http://${staticHost}/js/jquery.js"></script>
<script type="text/javascript" src="http://${staticHost}/js/continuingEducation.js"></script>
<script type="text/javascript" src="http://${staticHost}/js/ajaxFileUpload.js"></script>
<script src="http://${staticHost}/js/layer.js"></script>
    <link rel="stylesheet" type="text/css" href="http://${staticHost}/css/style1.css" />
#parse("/h5/common/datetime.html")
	<!--头部 begin -->
    #parse("/h5/common/headerTop.html")
    <!--头部 end -->
    <!--登出系统 begin-->
    #parse("/h5/common/loginHeader.html")
    <!--登出系统 end-->
<script type="text/javascript">
    $(document).ready(function(){
    	var checkStatus = false;
    	
        $("#submitForm").click(function(){
        	
        	var studentName = $("#studentName").val();
        	var sex = $("#sex").val();
        	var birthDate = $("#birthDate").val();
        	var age = $("#age").val();
        	var phoneNum = $("#phoneNum").val();
        	var standbyPhone = $("#standbyPhone").val();
        	var schoolRecord = $("#schoolRecord").val();
        	var major = $("#major").val();
        	var email = $("#email").val();
        	var workOfYeah = $("#workOfYeah").val();
        	var refereesCode = $("#refereesCode").val();
        	var recommendationCode = $("#recommendationCode").val();
        	var isCheck = $("#isCheck").val();
        	if(studentName == ''){
        		showMessage("姓名为必填项");
        		return;
        	}
        	if(sex == ''){
        		showMessage("性别为必填项");
        		return;
        	}
        	
        	if(birthDate == ''){
        		showMessage("生日为必填项");
        		return;
        	}
        	
        	if(age == ''){
        		showMessage("年龄为必填项");
        		return;
        	}
        	
        	if(phoneNum == ''){
        		showMessage("手机号为必填项");
        		return;
        	}
        	
        	if(standbyPhone == ''){
        		showMessage("备用手机为必填项");
        		return;
        	}
        	if(email == ''){
        		showMessage("邮箱地址为必填项");
        		return;
        	}
        	if(!checkTel(phoneNum)){
        		showMessage("请输入正确的手机号码");
        		return;
        	}
        	if(!checkTel(standbyPhone)){
        		showMessage("请输入正确的备用手机号码");
        		return;
        	}

        	if(!checkEmail(email)){
        		showMessage("请输入正确的邮箱地址");
        		return;
        	}
        	if(schoolRecord == ''){
        		showMessage("学历为必填项");
        		return;
        	}
        	if(schoolRecord >= 3){
        		if(major == ''){
            		showMessage("专业为必填项");
            		return;
            	}
        	}else{
                if(major != ''){
                    $("#major").val("");
                }
            }
        	if(workOfYeah == ''){
        		showMessage("工作年限为必填项");
        		return;
        	}
        	var reg = new RegExp(/^\d{6}$/);
            if(refereesCode && !reg.test(refereesCode)){
            	showMessage("请正确填写推荐码");
            	return false;
            }
            if(refereesCode == '' || recommendationCode !='' || isCheck == 'no'){
            	checkStatus = true;
            }
            if(checkStatus){
                checkStatus = false;
            	$.ajax({
                    url:"/personnelWork/auth/personalInfoFill",
                    data:$('#myForm').serialize(), // 从表单中获取数据
                    type:"POST", 
                    error:function(xmlHttpRequest, error) { // 设置表单提交出错
                    	console.log(error);
                    },
                    success:function(resData) {
                    	if(resData.status == '00000000'){
                    		var jobSeekerId = resData.info;
                    		var userJobSeekerId = resData.result.userJobSeekerId;
                    		var requestType = resData.result.requestType;
                    		if(requestType == 'toUserDetailedInfo'){
                    			window.location.href="/personnelWork/auth/myResume?jobId="+userJobSeekerId;
                    		}else{
    	                        window.location.href="/personnelWork/auth/applyJob?jobSeekerId="+jobSeekerId;
                    		}
                    	}else{
                    		showMessage(resData.message);
                            checkStatus = true;
                    	}
                    }
                });
            }
        });
        
        $("#refereesCode").blur(function(){
        	var refereesCode = $("#refereesCode").val();
        	if('' != refereesCode){
        		$.ajax({
                    url:"/personnelWork/auth/checkRefereesCode",//校验推荐码
                    data:{
                    	refereesCode:refereesCode
                    },
                    type:"POST", 
                    error:function(xmlHttpRequest, error) { // 设置表单提交出错
                    	console.log(error);
                    },
                    success:function(resData) {
                    	if(resData.status != '00000000'){
                    		$("#checkRefereesCode").text("推荐码无效,请与推荐老师联系,确认推荐码");
                            checkStatus = true;
                    		return false;
                    	}else if(resData.status == '00000000'){
                    		checkStatus = true;
                    		$("#checkRefereesCode").text("");
                    	}
                    }
                });
        	}
        });
    });
    
    function showMessage(msg){
    	layer.open({
            content: msg
            ,btn: '关闭'
        });
    }
    
    function showLoading(){
	    document.getElementById("over").style.display = "block";
	    document.getElementById("layout").style.display = "block";
	}
	
	function hideLoading(){
	    document.getElementById("over").style.display = "none";
	    document.getElementById("layout").style.display = "none";
	}
	function checkTel(mobile) {
	    var isPhone = /^([0-9]{0,4})?[0-9]{7,8}$/;
	    var isMob = /^((\+?86)|(\(\+86\)))?(13[0123456789][0-9]{8}|14[0123456789][0-9]{8}|15[0123456789][0-9]{8}|17[0123456789][0-9]{8}|18[0123456789][0-9]{8}|147[0-9]{8}|1349[0-9]{7}|16[0123456789][0-9]{8}|19[0123456789][0-9]{8})$/;
	    if (isMob.test(mobile) || isPhone.test(mobile)) {
	        return true;
	    } else {
	        return false;
	    }
	}

	function checkEmail(email){
        var myReg=/^[a-zA-Z0-9_-]+@([a-zA-Z0-9]+\.)+(com|cn|net|org)$/;
        if (myReg.test(email)) {
            return true;
        } else {
            return false;
        }
    }
	function selectschool(sel){
		if(sel.value >= 3){
			$(".specialtyshow").show();
		}else{
			$(".specialtyshow").hide();
		}
	}
</script>
     <style type="text/css">
    	.editMood{
            color: #333;
        }
         .current a {
             font-size: 20px;
         }
 
         .over {
             display: none;
             position: absolute;
             top: 1300px;
             left: 0;
             width: 100%;
             height: 800px;
             background-color: #f5f5f5;
             opacity:0.5;
             z-index: 1000;
         }

        .layout {
            display: none;
            position: absolute;
            top: 1500px;
            left: 40%;
            width: 20%;
            height: 20%;
            z-index: 1001;
            text-align:center;
        }
        .specialtyshow{display:none;}
        .markedwords{color:#666; padding-left:9px;}
        .jobtitle1{
            font-size: 18px;
            height: 50px;
            line-height: 50px;
            color: #333333;
            background-color: #fefeff;
            border-bottom: 1px solid #f8f7fc;
        }

     </style>
</head>


<body style="background-color:white;">
#parse("/h5/common/back.html")
<div align="center" class="jobtitle1">完善个人信息</div>
<div class="login-box">
    <div class="login-box-width">
    	<form id="myForm" action="">
        <ul>
            <li>
                <div class="form-box clearfix">
                #if (!$userMap.realName)
                	<input type="text" id="studentName" name="studentName" style="width: 94%;" value="" placeholder="姓名">
                #else 
                    <input type="text" id="studentName" name="studentName" style="width: 94%;background:#ffffff;" value="$userMap.realName" disabled="disabled" placeholder="姓名">
                #end
                </div>
                <!--<div style="color:#dc5c5c; padding-left:9px;">身份证真实姓名，如有错误，联系班主任更改</div>-->
            </li>
            <li class="password-input">
                <div class="form-box clearfix">
                    <select name="sex" id="sex" required="" style="background:#ffffff;" class="am-field-error am-active">
		              <option value="">请选择性别</option>
		              <option value="1" #if ($userMap.sex == 1) selected="selected" #end >男</option>
		              <option value="2" #if ($userMap.sex == 2) selected="selected" #end >女</option>
 				 	</select>
                </div>
            </li>
              <li>
                <div class="form-box clearfix" id="birthDateDiv">
                    <input type="text" id="birthDate" name="birthDate" style="width: 291px;" value="#if (!$userMap.birthDate)#else$userMap.birthDate#end" placeholder="出生年月">
                </div>
                <div class="markedwords">请选择正确出生日期</div>
            </li>
            <li>
                <div class="form-box clearfix" id="ageDiv">
                    <input type="text" id="age" name="age" readonly value="#if (!$userMap.age)#else$userMap.age#end" placeholder="年龄">
                </div>
                <div class="markedwords">请填写真实年龄</div>
            </li>
            <li>
                <div class="form-box clearfix" id="phoneNumDiv">
                    <input type="text" id="phoneNum" name="phoneNum" value="#if (!$userMap.mobilePhone)#else$userMap.mobilePhone#end" placeholder="手机号">
                </div>
                <div class="markedwords">请填写手机号</div>
            </li>
            <li>
                <div class="form-box clearfix" id="standbyPhoneNumDiv">
                    <input type="text" id="standbyPhone" name="standbyPhone" value="#if (!$userMap.spareContactPhone)#else$userMap.spareContactPhone#end" placeholder="备用手机号">
                </div>
                <div class="markedwords">请填写备用手机号</div>
            </li>
            <li>
                <div class="form-box clearfix" id="emailDiv">
                    <input type="text" id="email" name="email" value="#if (!$userMap.email)#else$userMap.email#end" placeholder="邮箱">
                </div>
                <div class="markedwords">请填写邮箱地址，如果没有请申请一个</div>
            </li>
            <li class="password-input">
                <div class="form-box clearfix">
                    <select name="schoolRecord" onchange="selectschool(this)" id="schoolRecord" required="" style="background:#ffffff;color: #757575;" class="am-field-error am-active">
                        #foreach($educationalRequirements in $educationalRequirementsList)
                        	<option value="$educationalRequirements.value" #if ($userMap.education == $educationalRequirements.value) selected="selected" #end >$educationalRequirements.label</option>
                        #end
                    </select>
                </div>
                <div class="markedwords">请选择正确学历</div>
            </li>
            <li class="specialtyshow" #if ($userMap.education!='' && $userMap.education!=1 && $userMap.education!=2))style="display:block;"#end>
                <div class="form-box clearfix" id="specialtyDiv" style="color: #757575;">
                    <input type="text" id="major" name="major" value="#if(!$userMap.major)#else$userMap.major#end" placeholder="专业">
                </div>
                <!--<div style="color:#dc5c5c; padding-left:9px;">请填写xx年xx月xx日，例如1985-07-08</div>-->
            </li>
            <li class="password-input">
                <div class="form-box clearfix">
                    <select name="workOfYeah" id="workOfYeah" required="" class="am-field-error am-active" style="background:#ffffff;color: #757575;">
                        <option value="">工作经验</option>
                        #foreach($workingLife in $workingLifeList)
                        	<option value="$workingLife.value" #if ($userMap.workingLife == $workingLife.value) selected="selected" #end >$workingLife.label</option>
                        #end
                    </select>
                </div>
                <div class="markedwords">请选择正确工作经验</div>
            </li>
            #if ((!$recommendationCode || $recommendationCode =='') && !$userMap.mobilePhone)
                <li>
                    <div class="form-box clearfix" id="refereesCodeDiv">
                        <input type="text" id="refereesCode" name="refereesCode" style="width: 94%;color: #757575;" placeholder="请输入推荐码(有推荐码者必填)">
                    </div>
                    <div style="color:red; padding-left:9px;" id="checkRefereesCode"></div>
                </li>
            #else
                <input type="hidden" id="refereesCode" name="refereesCode" value="#if(!$recommendationCode || $recommendationCode =='')$userMap.referralCode#else$recommendationCode#end">
            #end
        </ul>
        <input type="hidden" value="#if(!$userJobSeekerId)#else$userJobSeekerId#end" id="userJobSeekerId" name="userJobSeekerId" />
        <input type="hidden" value="#if(!$type)#else$type#end" id="requestType" name="requestType"/>
        <input type="hidden" value="#if(!$isCheck)#else$isCheck#end" id="isCheck" name="isCheck"/>
        <input type="hidden" value="#if(!$recommendationCode)#else$recommendationCode#end" id="recommendationCode" name="recommendationCode"/>
        </form>
    </div>
    <div class="md_dl"><input name="" id="submitForm" value="下一步" status="1" class="global-button-big" type="button" style="width:290px; color: white; height:42px; border:none; margin-top:20px; margin-bottom:30px;" /></div>
</div>

<div class="holderdiv"></div>
<div class="fixdiv">
  <ul>               
    <li>
    	<a href="javascript:void(0)" onclick="window.history.go(-1)">
    	<img src="http://${staticHost}/images/foticon001.jpg"><span>返回</span></a></li>
    <li><a href="/edu/auth/modifyPwd"><img src="http://${staticHost}/images/foticon004.jpg"><span>重置密码</span></a></li>
	<li><a href="javascript:void(0)" onclick="loginOut()"><img src="http://${staticHost}/images/foticon003.jpg"><span>退出系统</span></a></li>
  </ul>
</div>
<script>
$(document).ready(function(){
	var currYear = (new Date()).getFullYear();	
	var opt={};
	opt.date = {preset : 'date'};
	opt.datetime = {preset : 'datetime'};
	opt.time = {preset : 'time'};
	opt.default = {
		theme: 'android-ics light', //皮肤样式
		display: 'modal', //显示方式 
		mode: 'scroller', //日期选择模式
		dateFormat: 'yyyy-mm-dd',
		lang: 'zh',
		showNow: true,
		nowText: "今天",
		startYear: currYear - 60, //开始年份
		endYear: currYear - 16 //结束年份
	};
	
	$("#birthDate").mobiscroll($.extend(opt['date'], opt['default']));
	$("#birthDate").change(function(){
		$("#age").val((currYear - $(this).val().substr(0,4)));
	})
})
</script>
</body>
</html>
